<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>

<script type="text/javascript">
    var rowId = 0;

    $('.ui-reset , #refresh_ccrcollGrid').click(function(){
        $("#ccrcollGrid").jqGrid('setGridParam',{search:false});
        var postData = $("#ccrcollGrid").jqGrid('getGridParam','postData');
        $.extend(postData,{searchField:"",searchString:"",searchOper:""});
        $.extend(postData,{filters:""});
        $("#ccrcollGrid").trigger("reloadGrid");
    });

    $.subscribe('searchccrcollGrid', function(event,data) {
        $("#ccrcollGrid").jqGrid('searchGrid', {drag:true,closeAfterSearch:true,closeOnEscape:true,sopt:['eq'],caption:"Search ccrcoll"} );
    });
    
    $.subscribe('ccrcollGridComplete',function(event,data){
        $( "#ccrcollGrid_search" ).button( "option", "disabled", false );
        $( "#ccrcollGrid_showhide" ).button( "option", "disabled", false );
    });
    
    $.subscribe('showhideccrcollGrid', function(event,data) {
        $("#ccrcollGrid").jqGrid('setColumns',{});
    });

</script>
<div class="gridOptsContainer">
    <sj:submit button="true" cssStyle="font-size:14px;" disabled="true" id="ccrcollGrid_search" onClickTopics="searchccrcollGrid" value="Search ccrcoll"/>
    <sj:submit button="true" cssStyle="font-size:14px;" disabled="true" id="ccrcollGrid_showhide" onClickTopics="showhideccrcollGrid" value="Show/Hide Columns"/>

</div>
<s:url id="remoteurl" action="grid-ccrcoll"/>

<sjg:grid
    id="ccrcollGrid"
    caption="Cashmate ccrcoll"
    dataType="json"
    href="%{remoteurl}"
    gridModel="gridModel"
    groupField="['branchid']"
    groupColumnShow="[false]"
    groupCollapse="true"
    pagerButtons="true"
    pagerInput="true"
    rowList="10,20,50"
    rowNum="50"
    loadingText="Requesting Data..."
    width="970"
    shrinkToFit="true"
    pager="true"
    hoverrows="true"
    rownumbers="true"
    autoencode="true"
    viewrecords="true"
    navigator="true"
    navigatorAdd="false"
    navigatorDelete="false"
    navigatorEdit="false"
    navigatorSearch="true"
    navigatorView="true"
    onGridCompleteTopics="ccrcollGridComplete"

    >

    
    <sjg:gridColumn name="ccrcollid"
                    index="ccrcollid"
                    title="Collection id. (Not Editable)"
                    sortable="false"
                    key="true"
                    hidden="true"/>


    <sjg:gridColumn name="beginbalcoh"
                    index="beginbalcoh"
                    title="Beginning Balance COH"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="beginbalcib"
                    index="beginbalcib"
                    title="Beginning Balance CIB"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="endbalcoh"
                    index="endbalcoh"
                    title="Ending Balance COH"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="endbalcib"
                    index="endbalcib"
                    title="Ending Balance CIB"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="endbaltotalcash"
                    index="endbaltotalcash"
                    title="Ending Balance Total Cash"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="collcib"
                    index="collcib"
                    title="Collections CIB"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="collcoh"
                    index="collcoh"
                    title="Collections COH"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="colltotalcash"
                    index="colltotalcash"
                    title="Collections Total Cash"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />

    <sjg:gridColumn name="depositcoh"
                    index="depositcoh"
                    title="Deposit Cash on Hand"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    <sjg:gridColumn name="depositcib"
                    index="depositcib"
                    title="Deposit Cash in Bank"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    <sjg:gridColumn name="deposittotalcash"
                    index="deposittotalcash"
                    title="Deposit Total Cash"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />

    <sjg:gridColumn name="disbursementcoh"
                    index="disbursementcoh"
                    title="Disbursement COH"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />

    <sjg:gridColumn name="disbursementcib"
                    index="disbursementcib"
                    title="Disbursement CIB"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />
    
    <sjg:gridColumn name="disbursementtotalcash"
                    index="disbursementtotalcash"
                    title="Disbursement Total Cash"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />

    <sjg:gridColumn name="branchid"
                    index="branchid"
                    title="Branch"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    />





</sjg:grid>
